package cn.daniellee.plugin.se.storage;

import cn.daniellee.plugin.se.model.PlayerData;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public abstract class Storage {

	Map<String, PlayerData> playerDataCache = new HashMap<>();

	public PlayerData getPlayerData(String name) {
		PlayerData playerData = playerDataCache.get(name);
		if (playerData == null) playerData = refreshPlayerData(name);
		return playerData;
	}

	public abstract boolean initialize();

	public abstract PlayerData refreshPlayerData(String name);

	public abstract void updatePlayerData(String name, String column, int value);

	public abstract List<PlayerData> getAllPlayerData();
}
